package com.ey12.service;

import java.util.List;

import com.ey12.db.dao.GmCpDAO;
import com.ey12.db.domain.GmComplain;
import com.ey12.db.domain.GmCp;
import com.ey12.db.domain.GmUser;
import com.ey12.utils.DateUtil;

public class GmCpService {
	private GmCpDAO gmCpDAO;

	public void setGmCpDAO(GmCpDAO gmCpDAO) {
		this.gmCpDAO = gmCpDAO;
	}

	public GmCpDAO getGmCpDAO() {
		return gmCpDAO;
	}
	public List getAll(){
		return gmCpDAO.findAll();
	}
	public void deleteCp(GmCp g){
		gmCpDAO.delete(g);
	}
	public String test(GmCp g){
		gmCpDAO.delete(g);
		return "hello";
	}
	public void addCp(String mobile,String name,String qq,String email,String project,String remark) {
		GmCp cp = new GmCp();
		cp.setName(name);
		cp.setMobile(mobile);
		cp.setQq(qq);
		cp.setEmail(email);
		cp.setProject(project);
		cp.setRemark(remark);
		gmCpDAO.saveOrUpdate(cp);
	}
}
